<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>合伙人审核</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="/public/index/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/public/index/css/iconfont.css" />
		<link rel="stylesheet" href="/public/index/css/style.css" />
		<link rel="stylesheet" href="/public/index/css/mall.css" />	
		<script type="text/javascript" src="/public/index/dist/jquery.min.js" ></script>
		<script type="text/javascript" src="/public/index/js/menudown.js" ></script>
	</head>

	<body>
		
		<div class="mui-content">
			{include file="public/city" /}
			<div class="glj_bt"><span class="mui-icon iconfont icon-dingdan4" style="font-size: .9rem;"></span><em style="padding-left:5px;">合伙人审核</em></div>
			 <ul class="record_list2">
		    	<li class="clearfix">
		    		<div class="pj">申请人</div>
		    		<div class="pj">联系电话</div>
		    		<div class="pj1">申请时间</div>
		    		<div class="pj">付款凭证</div>
		    		<div class="pj">操作</div>
	    		</li>
		    </ul>
			<p id="no_record" style="color:#D6AA50;text-align: center;display: none;">数据已加载完毕</p>
		</div>
		<input type="hidden" id="page" value="1" />
		{include file="public/bottom" /}
	</body>

</html>
<script src="/public/static/js/jquery.qrcode.js"></script>
<script src="/public/static/js/utf.js"></script>
<script type="text/javascript" src="/public/static/layui/layui.all.js"></script>
<script>
	get_data();
	function get_data(){
			$.ajax({
			type:"post",
			data:{
				page:$("#page").val()
			},
			url:"{:url('index/city/ptsh_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
				    		'<div class="pj">'+log.name+'</div>'+
				    		'<div class="pj">'+log.mobile+'</div>'+
				    		'<div class="pj1">'+log.add_time.substring(0,10)+'</div>'+
				    		'<div class="pj"><img style="width:40px;height:40px;" src="'+log.pz+'"/></div>'+
				    		'<div class="pj"><a style="width: 80px;color:red;" onclick="shenghe('+log.id+',2,this)">通过</a>&nbsp;<a style="width: 80px;color:red;" onclick="shenghe('+log.id+',3,this)">驳回</a></div>'+
			    			'</li>';
					}
				}else{
					$("#no_record").show();
				}
				$(".record_list2").append(html);
				
			}
		});
	}
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('index/admin/ptsh_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i];
	    				html+='<li class="clearfix">'+
				    		'<div class="pj">'+log.name+'</div>'+
				    		'<div class="pj">'+log.mobile+'</div>'+
				    		'<div class="pj1">'+log.add_time.substring(0,10)+'</div>'+
				    		'<div class="pj"><img style="width:40px;height:40px;" src="'+log.pz+'"/></div>'+
				    		'<div class="pj"><a style="width: 80px;color:red;" onclick="shenghe('+log.id+',2,this)">通过</a>&nbsp;<a style="width: 80px;color:red;" onclick="shenghe('+log.id+',3,this)">驳回</a></div>'+
			    			'</li>';
					}
				}
				$(".record_list2").append(html);
				
			}
		});
		
		}				
	})
	
	//确认审核
	function shenghe(id,status,obj) {
		var tiele = '';
		var lock = false; //默认未锁定
		layer.confirm('确认操作？', {
			btn: ['确定', '取消'] //按钮
		}, function() {
			if(!lock) {
                lock = true; // 锁定
				$.ajax({
					type: 'post',
					url: "{:url('index/admin/shenghe')}",
					dataType: 'json',
					data: {
						id: id,
						status:status
					},
					success: function(data) {
						layer.msg(data.msg, {
						  icon: 1,
						  time: 1000 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							$(obj).parent().parent().remove();
						});
					}
				});
			}
		});
	}
	

</script>
